package com.gan.simple_init.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gan.simple_init.model.user.entity.SysUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author gbw
 * @date 2023/8/8
 */
@Mapper
public interface SysUserMapper extends BaseMapper<SysUser> {
    /**
     * 根据用户 id 查询权限
     */
    List<String> selectRolesById(@Param("id") Long id);

    /**
     * 注册用户默认为普通用户
     * @param userId
     * @param roleId
     * @return
     */
    int insertNewUserRole(@Param("userId") Long userId,@Param("roleId") Long roleId);
}
